﻿Imports System.Windows.Forms

Public Class edit
    Public UpID As String

    Private Sub OKButton_Click(sender As Object, e As EventArgs) Handles OKButton.Click
        Dim con As New Odbc.OdbcConnection
        con.ConnectionString = My.Settings.con
        'Dim sqlcommand As String = "DELETE FROM `records` WHERE upid = '" & UpID & "'"
        Dim sqlcommand As String = "UPDATE `records` SET `vendor`='" & cmbvendor.Text.ToUpper & "',`title`='" & txttitle.Text & "',`docutype`='" & cmbdocument.Text & "',`dateissue`='" & dateissued.Value & "',`description1`='" & TextBoxDescription.Text & "',`Reference1`='" & txtref1.Text & "',`Reference2`='" & txtref2.Text & "',`CheckNumber`='" & txtcheck1.Text & "' where upid = '" & UpID & "';"
        Dim cmd As New Odbc.OdbcCommand(sqlcommand, con)
        Try
            con.Open()
            cmd.ExecuteNonQuery()
            Me.Dispose()

        Catch ex As Exception
            MsgBox(ex.Message)
        End Try
    End Sub

    Private Sub edit_Load(sender As Object, e As EventArgs) Handles MyBase.Load

    End Sub
End Class
